package text20251109;

public class demo04 {
    public static void main(String[] args) {
        //int a = 100;
        //long b = a;
        //float c = b;
        //System.out.println(c); float是小数

        //double x = 3.14159;
        //int y = (int) x;
        //byte z = (byte) 130;
        //System.out.println("y = " + y);double强制转换为int
        //System.out.println("z = " + z);超过byte值范围

        short s1 = 10;
        short s2 = 20;
        short s3 = (short) (s1 + s2);
        System.out.println(s3);
        // 编译报错？int要强制转换为sho
    }
}
